<template>
  <el-space>
    <el-tooltip content="下载文件">
      <el-button
        type="primary"
        :icon="Download"
        circle
        @click="handleDownload"
      />
    </el-tooltip>
    <el-tooltip content="复制路径">
      <el-button
        type="info"
        :icon="DocumentCopy"
        circle
        @click="handleCopyPath"
      />
    </el-tooltip>
  </el-space>
</template>

<script lang="ts" setup>
import { Download, DocumentCopy } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'

const props = defineProps<{
  filePath: string;
}>();

const handleDownload = () => {
  // 实现下载功能
};

const handleCopyPath = async () => {
  try {
    await navigator.clipboard.writeText(props.filePath);
    ElMessage.success('路径已复制到剪贴板');
  } catch (err) {
    ElMessage.error('复制失败');
  }
};
</script> 